home *** CD-ROM | disk | FTP | other *** search
/ Wildcat Files 2 / The Wildcat Files 2 (Arsenal Computer).ISO / wildcat / release.pas < prev    next >
Pascal/Delphi Source File  |  1994-04-02  |  4KB  |  103 lines

  1. {RESPONSIBILITY: SLR}
  2. (******************************************************************
  3.  
  4. Global record structure for wcUUCP! version 3.90B.
  5. Copyright 1986,94 Mustang Software Inc.  All rights reserved.
  6.  
  7. Last Revised 12-23-93
  8.  
  9. ******************************************************************)
  10.  
  11.  
  12. type
  13.   TWCUUCPConfig = record                {wcUUCP.CFG file}
  14.     Filler             : Array [1..117] of byte;  {Expansion}
  15.     UUCP_Admin         : Str25;                   {Administrators name}
  16.     UUCP_EmailConf     : Word;                    {Conference for Email}
  17.     UUCP_Domain        : String;                  {Domain name}
  18.     UUCP_Organization  : Str80;                   {Organization string}
  19.     UUCP_Distribution  : Str80;                   {Distribution string}
  20.     UUCP_ImportPath    : DirStr;                  {Import path}
  21.     UUCP_ExportPath    : DirStr;                  {Export path}
  22.     UUCP_DeletePackets : Boolean;                 {Delete files after import?}
  23.     UUCP_SiteName      : Str80;                   {Host Site name}
  24.     UUCP_GMT_HourOfs   : Integer;                 {Hours offset from GMT}
  25.     UUCP_GMT_MinOfs    : Byte;                    {Minutes offset from GMT}
  26.     UUCP_AttachLimit   : LongInt;                 {Total outgoing attachment limit}
  27.     UUCP_Satellite     : Boolean;                 {Satellite?}
  28.     UUCP_PageSatBagPath: DirStr;                  {Satellite import path}
  29.     UUCP_OurSiteName   : String;                  {Also in SITENAME.TXT}
  30.     UUCP_WaffleSupport : Boolean;                 {Use Waffle UUCICO?}
  31.   end;
  32.  
  33.   NewsGroupRec = record    {NEWSGRPS.DAT file!}
  34.     GroupName : String;    {Usenet NewsGroup name}
  35.     Conference: Word;      {WildCat! Conference Number}
  36.   end;
  37.  
  38.   TrnType = (TrnImport, TrnExport, TrnBoth, TCanImport, TCanExport);
  39.   KeyType = (InternalName, ExternalName);
  40.  
  41.   PTransRec = ^TTransRec;  {WCUUCP.DAT/.IX  -- BTREE FILER DATABASE!}
  42.   TTransRec = record
  43.     Status  : LongInt;                  {Deleted?}
  44.     Name    : Str25;                    {Internal name Wildcat Name}
  45.     TranName: String;                   {External name}
  46.     Flag    : Byte;                     {Translate type}
  47.   end;
  48.  
  49.  
  50. {Below is the constructor to create the Translate database!}
  51.  
  52.   constructor TTransObj.Init(TrnFile : PathStr);
  53.   var
  54.     IID : IsamIndDescr;
  55.  
  56.   begin
  57.     if NOT ExistFile(TrnFile+'.DAT') then
  58.       begin
  59.         IID[1].KeyL := 25;
  60.         IID[2].KeyL := 5;
  61.         IID[3].KeyL := 30;
  62.         IID[1].AllowDupK := True;
  63.         IID[2].AllowDupK := False;
  64.         IID[3].AllowDupK := True;
  65.  
  66.         BTCreateFileBlock(TrnFile, SizeOf(TTransRec), 3, IID);
  67.         if NOT IsamOk then
  68.           Fail;
  69.       end;
  70.     BTOpenFileBlock(pf, TrnFile, False, False, False, False);
  71.     if NOT IsamOk then
  72.       Fail;
  73.   end;
  74.  
  75. {Build key routines}
  76.  
  77.   function TTransObj.BuildKey(KeyNum : Byte; const Name : String) : IsamKeyStr;
  78.   var
  79.     Key : String;
  80.     Crc : LongInt;
  81.     Cnt : Byte;
  82.  
  83.   begin
  84.     case KeyNum of
  85.       1:begin
  86.           Key := Name;
  87.           BuildKey := Pad(StUpCase(Trim(Key)), 25);
  88.         end;
  89.       2:begin
  90.           Crc := -1;
  91.           Key := StUpCase(Trim(Name));
  92.           for Cnt := 1 to Length(Key) do
  93.             Crc := UpdateCrc32(Byte(Key[Cnt]), Crc);
  94.           BuildKey := LongToKey(Crc)+Chr(Length(Key));
  95.         end;
  96.       3:begin
  97.           Key := Copy(Name, 1, 30);
  98.           BuildKey := Pad(StUpCase(Key), 30);
  99.         end;
  100.     end;
  101.   end;
  102.  
  103.